package com.example.mypotiota_si.Activity;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.ViewPager;

import android.content.Intent;
import android.os.Bundle;
import android.text.Layout;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;

import com.ashokvarma.bottomnavigation.BottomNavigationBar;
import com.ashokvarma.bottomnavigation.BottomNavigationItem;
import com.example.mypotiota_si.Adapter.PmPagerAdapter;
import com.example.mypotiota_si.R;
import com.google.android.material.bottomnavigation.BottomNavigationView;

import java.util.ArrayList;
import java.util.List;

public class PaiMingActivity extends AppCompatActivity {
    private ImageView pm_fh;
    private List<View> viewList;
    private View view1;
    private View view2;
    private PmPagerAdapter pm_adapter;
    ViewPager pm_viewPager;
    BottomNavigationView bottomNavigationView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pai_ming);
        //隐藏标题栏
        ActionBar actionBar=getSupportActionBar();
        if (actionBar!=null){
            actionBar.hide();
        }
        //找到控件
        viewList=new ArrayList<>();
        view1=LayoutInflater.from(this).inflate(R.layout.activity_pm_hpb,null,false);
        view2= LayoutInflater.from(this).inflate(R.layout.activity_pm_xlb,null,false);
        viewList.add(view1);
        viewList.add(view2);
        pm_fh=findViewById(R.id.pm_fh);
        pm_viewPager=findViewById(R.id.pm_view_pager);

        pm_adapter=new PmPagerAdapter(PaiMingActivity.this,viewList);
        pm_viewPager.setAdapter(pm_adapter);


        init_dj();
    }
    //点击事件
    private void init_dj() {
        //点击事件
        pm_fh.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(PaiMingActivity.this,MainActivity.class);
                startActivity(intent);
            }
        });
    }
}
